<template>
  <div class="home">
    <el-header style="text-align: right; font-size: 12px">
      <el-dropdown>
        <i class="el-icon-setting" style="margin-right: 15px"></i>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item>个人信息</el-dropdown-item>
          <el-dropdown-item>退出</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
      
      <span>{{username}}</span>
    </el-header>
    <el-main>后台首页</el-main>
  </div>
</template>
        
<script>
import { mapState } from "vuex";
export default {
  computed: {
    // username() {
    //   return this.$store.state.userinfo.username;
    // },
    ...mapState({
      username: state => state.userinfo.username
    })

  },
};
</script>

<style  scoped>
.home {
  width: 100%;
}
.el-header {
  background-color: #b3c0d1;
  color: #333;
  line-height: 60px;
}

.el-aside {
  color: #333;
}
</style>